{extend name="common/base" /}

{block name="body"}
{js href='__STATIC__/js/echarts.min.js' /}
<div style="padding: 0px 10px 0px 10px;">
    <form action="" class="layui-form" method="get">
        <div class="layui-form-item">
            <div class="layui-inline">
                <label class="layui-form-label">起始时间</label>
                <div class="layui-input-inline">
                    <input name="times" id="rhaphp-time1" value="{$sh.times}" class="layui-input" placeholder="开始时间 到 结束时间" lay-key="17" type="text">
                </div>
            </div>


            <div class="layui-inline">
                <div class="layui-input-block">
                    <button type="submit" class="layui-btn layui-btn-sm layui-btn-normal">
                        <i class="layui-icon">&#xe615;</i>
                        搜索</button>
                </div>
            </div>
        </div>
    </form>
    <div id="main" style="height:400px;"></div>

</div>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('main'));

    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '{$total_title}'
        },
        tooltip: {
            trigger: 'axis'
        },
        legend: {
            data:JSON.parse('{$legend|raw}')
        },
        grid: {
            left: '3%',
            right: '4%',
            bottom: '3%',
            containLabel: true
        },
        toolbox: {
            feature: {
                saveAsImage: {}
            }
        },
        xAxis: {
            type: 'category',
            boundaryGap: false,
            data: JSON.parse('{$xAxis|raw}')
        },
        yAxis: {
            type: 'value'
        },
        series: JSON.parse('{$series|raw}')
    };


    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);


    layui.use('laydate', function() {
        var laydate = layui.laydate;
        var ins1 = laydate.render( {
            elem: '#rhaphp-time1'
            ,type: 'datetime'
            ,range: '到'
            ,format: 'yyyy-M-d'
            ,max: '{$max_date}'

        });
    })
</script>


{/block}